;
(function () {
    function _typeof(o) {
        "@babel/helpers - typeof";
        return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
            return typeof o;
        } : function (o) {
            return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
        }, _typeof(o);
    }

    function _regeneratorRuntime() {
        "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
        _regeneratorRuntime = function _regeneratorRuntime() {
            return e;
        };
        var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) {
                t[e] = r.value;
            }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator",
            c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag";

        function define(t, e, r) {
            return Object.defineProperty(t, e, {value: r, enumerable: !0, configurable: !0, writable: !0}), t[e];
        }

        try {
            define({}, "");
        } catch (t) {
            define = function define(t, e, r) {
                return t[e] = r;
            };
        }

        function wrap(t, e, r, n) {
            var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype),
                c = new Context(n || []);
            return o(a, "_invoke", {value: makeInvokeMethod(t, r, c)}), a;
        }

        function tryCatch(t, e, r) {
            try {
                return {type: "normal", arg: t.call(e, r)};
            } catch (t) {
                return {type: "throw", arg: t};
            }
        }

        e.wrap = wrap;
        var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {};

        function Generator() {
        }

        function GeneratorFunction() {
        }

        function GeneratorFunctionPrototype() {
        }

        var p = {};
        define(p, a, function () {
            return this;
        });
        var d = Object.getPrototypeOf, v = d && d(d(values([])));
        v && v !== r && n.call(v, a) && (p = v);
        var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);

        function defineIteratorMethods(t) {
            ["next", "throw", "return"].forEach(function (e) {
                define(t, e, function (t) {
                    return this._invoke(e, t);
                });
            });
        }

        function AsyncIterator(t, e) {
            function invoke(r, o, i, a) {
                var c = tryCatch(t[r], t, o);
                if ("throw" !== c.type) {
                    var u = c.arg, h = u.value;
                    return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
                        invoke("next", t, i, a);
                    }, function (t) {
                        invoke("throw", t, i, a);
                    }) : e.resolve(h).then(function (t) {
                        u.value = t, i(u);
                    }, function (t) {
                        return invoke("throw", t, i, a);
                    });
                }
                a(c.arg);
            }

            var r;
            o(this, "_invoke", {
                value: function value(t, n) {
                    function callInvokeWithMethodAndArg() {
                        return new e(function (e, r) {
                            invoke(t, n, e, r);
                        });
                    }

                    return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
                }
            });
        }

        function makeInvokeMethod(e, r, n) {
            var o = h;
            return function (i, a) {
                if (o === f) throw Error("Generator is already running");
                if (o === s) {
                    if ("throw" === i) throw a;
                    return {value: t, done: !0};
                }
                for (n.method = i, n.arg = a; ;) {
                    var c = n.delegate;
                    if (c) {
                        var u = maybeInvokeDelegate(c, n);
                        if (u) {
                            if (u === y) continue;
                            return u;
                        }
                    }
                    if ("next" === n.method) n.sent = n._sent = n.arg; else if ("throw" === n.method) {
                        if (o === h) throw o = s, n.arg;
                        n.dispatchException(n.arg);
                    } else "return" === n.method && n.abrupt("return", n.arg);
                    o = f;
                    var p = tryCatch(e, r, n);
                    if ("normal" === p.type) {
                        if (o = n.done ? s : l, p.arg === y) continue;
                        return {value: p.arg, done: n.done};
                    }
                    "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
                }
            };
        }

        function maybeInvokeDelegate(e, r) {
            var n = r.method, o = e.iterator[n];
            if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
            var i = tryCatch(o, e.iterator, r.arg);
            if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
            var a = i.arg;
            return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
        }

        function pushTryEntry(t) {
            var e = {tryLoc: t[0]};
            1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
        }

        function resetTryEntry(t) {
            var e = t.completion || {};
            e.type = "normal", delete e.arg, t.completion = e;
        }

        function Context(t) {
            this.tryEntries = [{tryLoc: "root"}], t.forEach(pushTryEntry, this), this.reset(!0);
        }

        function values(e) {
            if (e || "" === e) {
                var r = e[a];
                if (r) return r.call(e);
                if ("function" == typeof e.next) return e;
                if (!isNaN(e.length)) {
                    var o = -1, i = function next() {
                        for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
                        return next.value = t, next.done = !0, next;
                    };
                    return i.next = i;
                }
            }
            throw new TypeError(_typeof(e) + " is not iterable");
        }

        return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
            value: GeneratorFunctionPrototype,
            configurable: !0
        }), o(GeneratorFunctionPrototype, "constructor", {
            value: GeneratorFunction,
            configurable: !0
        }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
            var e = "function" == typeof t && t.constructor;
            return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
        }, e.mark = function (t) {
            return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
        }, e.awrap = function (t) {
            return {__await: t};
        }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
            return this;
        }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
            void 0 === i && (i = Promise);
            var a = new AsyncIterator(wrap(t, r, n, o), i);
            return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
                return t.done ? t.value : a.next();
            });
        }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
            return this;
        }), define(g, "toString", function () {
            return "[object Generator]";
        }), e.keys = function (t) {
            var e = Object(t), r = [];
            for (var n in e) r.push(n);
            return r.reverse(), function next() {
                for (; r.length;) {
                    var t = r.pop();
                    if (t in e) return next.value = t, next.done = !1, next;
                }
                return next.done = !0, next;
            };
        }, e.values = values, Context.prototype = {
            constructor: Context, reset: function reset(e) {
                if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
            }, stop: function stop() {
                this.done = !0;
                var t = this.tryEntries[0].completion;
                if ("throw" === t.type) throw t.arg;
                return this.rval;
            }, dispatchException: function dispatchException(e) {
                if (this.done) throw e;
                var r = this;

                function handle(n, o) {
                    return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
                }

                for (var o = this.tryEntries.length - 1; o >= 0; --o) {
                    var i = this.tryEntries[o], a = i.completion;
                    if ("root" === i.tryLoc) return handle("end");
                    if (i.tryLoc <= this.prev) {
                        var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc");
                        if (c && u) {
                            if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
                            if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
                        } else if (c) {
                            if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
                        } else {
                            if (!u) throw Error("try statement without catch or finally");
                            if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
                        }
                    }
                }
            }, abrupt: function abrupt(t, e) {
                for (var r = this.tryEntries.length - 1; r >= 0; --r) {
                    var o = this.tryEntries[r];
                    if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
                        var i = o;
                        break;
                    }
                }
                i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
                var a = i ? i.completion : {};
                return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
            }, complete: function complete(t, e) {
                if ("throw" === t.type) throw t.arg;
                return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
            }, finish: function finish(t) {
                for (var e = this.tryEntries.length - 1; e >= 0; --e) {
                    var r = this.tryEntries[e];
                    if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
                }
            }, catch: function _catch(t) {
                for (var e = this.tryEntries.length - 1; e >= 0; --e) {
                    var r = this.tryEntries[e];
                    if (r.tryLoc === t) {
                        var n = r.completion;
                        if ("throw" === n.type) {
                            var o = n.arg;
                            resetTryEntry(r);
                        }
                        return o;
                    }
                }
                throw Error("illegal catch attempt");
            }, delegateYield: function delegateYield(e, r, n) {
                return this.delegate = {
                    iterator: values(e),
                    resultName: r,
                    nextLoc: n
                }, "next" === this.method && (this.arg = t), y;
            }
        }, e;
    }

    function asyncGeneratorStep(n, t, e, r, o, a, c) {
        try {
            var i = n[a](c), u = i.value;
        } catch (n) {
            return void e(n);
        }
        i.done ? t(u) : Promise.resolve(u).then(r, o);
    }

    function _asyncToGenerator(n) {
        return function () {
            var t = this, e = arguments;
            return new Promise(function (r, o) {
                var a = n.apply(t, e);

                function _next(n) {
                    asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
                }

                function _throw(n) {
                    asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
                }

                _next(void 0);
            });
        };
    }

    function _toConsumableArray(r) {
        return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
    }

    function _nonIterableSpread() {
        throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    }

    function _unsupportedIterableToArray(r, a) {
        if (r) {
            if ("string" == typeof r) return _arrayLikeToArray(r, a);
            var t = {}.toString.call(r).slice(8, -1);
            return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
        }
    }

    function _iterableToArray(r) {
        if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
    }

    function _arrayWithoutHoles(r) {
        if (Array.isArray(r)) return _arrayLikeToArray(r);
    }

    function _arrayLikeToArray(r, a) {
        (null == a || a > r.length) && (a = r.length);
        for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
        return n;
    }

    function ownKeys(e, r) {
        var t = Object.keys(e);
        if (Object.getOwnPropertySymbols) {
            var o = Object.getOwnPropertySymbols(e);
            r && (o = o.filter(function (r) {
                return Object.getOwnPropertyDescriptor(e, r).enumerable;
            })), t.push.apply(t, o);
        }
        return t;
    }

    function _objectSpread(e) {
        for (var r = 1; r < arguments.length; r++) {
            var t = null != arguments[r] ? arguments[r] : {};
            r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
                _defineProperty(e, r, t[r]);
            }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
                Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
            });
        }
        return e;
    }

    function _defineProperty(e, r, t) {
        return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
            value: t,
            enumerable: !0,
            configurable: !0,
            writable: !0
        }) : e[r] = t, e;
    }

    function _toPropertyKey(t) {
        var i = _toPrimitive(t, "string");
        return "symbol" == _typeof(i) ? i : i + "";
    }

    function _toPrimitive(t, r) {
        if ("object" != _typeof(t) || !t) return t;
        var e = t[Symbol.toPrimitive];
        if (void 0 !== e) {
            var i = e.call(t, r || "default");
            if ("object" != _typeof(i)) return i;
            throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === r ? String : Number)(t);
    }

    System.register(['./SimpleCollapse.vue_vue_type_script_setup_true_lang-legacy-WngZx8ev.js', './IconButton.vue_vue_type_script_setup_true_lang-legacy-jwPT8TzR.js', './SelectGroup.vue_vue_type_script_setup_true_lang-legacy-DczqbOUF.js', './index-legacy-BBSVeb5I.js', './job-legacy-CNDgX1kt.js', './dateUtils-legacy-0RWazmFe.js', './SimpleDrawer.vue_vue_type_script_setup_true_lang-legacy-hDhCqA-5.js', './useCopy-legacy-BVMLXgLP.js'], function (exports, module) {
        'use strict';

        var _sfc_main$3, _sfc_main$5, _sfc_main$9, _sfc_main$8, _sfc_main$7, defineComponent, mergeModels, useModel,
            computed, createBlock, withCtx, createBaseVNode, toDisplayString, createElementBlock, unref, Fragment,
            createVNode, createCommentVNode, createTextVNode, openBlock, useRoute, ref, onMounted, isRef,
            withDirectives, vShow, normalizeClass, renderList, normalizeStyle, resolveComponent, dayjs, useRouter, api,
            _export_sfc, resolveDynamicComponent, Suspense, getJobList, deleteJob, formatToDateTime,
            getHashColorFromString, _sfc_main$6, useCopy, _sfc_main$4;
        return {
            setters: [function (module) {
                _sfc_main$3 = module._;
                _sfc_main$5 = module.a;
                _sfc_main$9 = module.b;
            }, function (module) {
                _sfc_main$8 = module._;
            }, function (module) {
                _sfc_main$7 = module._;
            }, function (module) {
                defineComponent = module.d;
                mergeModels = module.J;
                useModel = module.m;
                computed = module.f;
                createBlock = module.c;
                withCtx = module.p;
                createBaseVNode = module.b;
                toDisplayString = module.t;
                createElementBlock = module.a;
                unref = module.u;
                Fragment = module.F;
                createVNode = module.q;
                createCommentVNode = module.k;
                createTextVNode = module.v;
                openBlock = module.o;
                useRoute = module.h;
                ref = module.e;
                onMounted = module.K;
                isRef = module.y;
                withDirectives = module.L;
                vShow = module.M;
                normalizeClass = module.n;
                renderList = module.j;
                normalizeStyle = module.H;
                resolveComponent = module.r;
                dayjs = module.N;
                useRouter = module.g;
                api = module.G;
                _export_sfc = module._;
                resolveDynamicComponent = module.O;
                Suspense = module.S;
            }, function (module) {
                getJobList = module.g;
                deleteJob = module.d;
            }, function (module) {
                formatToDateTime = module.f;
                getHashColorFromString = module.g;
            }, function (module) {
                _sfc_main$6 = module._;
            }, function (module) {
                useCopy = module.u;
                _sfc_main$4 = module._;
            }],
            execute: function execute() {
                var __vite_style__ = document.createElement('style');
                __vite_style__.textContent = "\n.i-carbon-arrow-down[data-v-e5b446fd],\r\n.i-carbon-arrow-up[data-v-e5b446fd] {\r\n  display: inline-block;\r\n  vertical-align: middle;\r\n  margin-left: 2px;\r\n  margin-top: -2px;\r\n  opacity: 0.7;\n}\r\n/*$vite$:1*/";
                document.head.appendChild(__vite_style__);

                function getStatusColor(status) {
                    switch (status) {
                        case "RUNNING":
                            return "blue-badge";
                        case "COMPLETED":
                            return "green-badge";
                        case "FAILED":
                        case "CREATE_FAILED":
                            return "red-badge";
                        default:
                            return "gray-badge";
                    }
                }

                var _hoisted_1$1 = {
                    class: "h-full w-640px flex flex-col"
                };
                var _hoisted_2$1 = {
                    flex: "~ gap2 none items-center justify-between",
                    border: "b base",
                    class: "relative h-8 bg-hover px-4"
                };
                var _hoisted_3$1 = {
                    class: "font-600"
                };
                var _hoisted_4$1 = {
                    class: "flex-1 overflow-y-overlay p-3"
                };
                var _sfc_main$2 = /* @__PURE__ */defineComponent({
                    __name: "job-detail-drawer",
                    props: /* @__PURE__ */mergeModels({
                        job: {}
                    }, {
                        "modelValue": {
                            type: Boolean
                        },
                        "modelModifiers": {}
                    }),
                    emits: ["update:modelValue"],
                    setup: function setup(__props) {
                        var props = __props;
                        var show = useModel(__props, "modelValue");
                        var formatedJob = computed(function () {
                            if (!props.job) return null;
                            var decodedJob = _objectSpread(_objectSpread({}, props.job), {}, {
                                sql: void 0,
                                createTime: props.job.createTime ? formatToDateTime(props.job.createTime) : void 0
                            });
                            return JSON.stringify(decodedJob, null, 2);
                        });
                        var _useCopy = useCopy(),
                            copy = _useCopy.copy,
                            copied = _useCopy.copied;
                        var _useCopy2 = useCopy(),
                            copySql = _useCopy2.copy,
                            sqlCopied = _useCopy2.copied;
                        return function (_ctx, _cache) {
                            var _component_ShikiCode = _sfc_main$4;
                            var _component_SimpleCollapse = _sfc_main$3;
                            var _component_Empty = _sfc_main$5;
                            var _component_SimpleDrawer = _sfc_main$6;
                            return openBlock(), createBlock(_component_SimpleDrawer, {
                                modelValue: show.value,
                                "onUpdate:modelValue": _cache[2] || (_cache[2] = function ($event) {
                                    return show.value = $event;
                                })
                            }, {
                                default: withCtx(function () {
                                    var _ctx$job, _ctx$job2;
                                    return [createBaseVNode("div", _hoisted_1$1, [createBaseVNode("div", _hoisted_2$1, [createBaseVNode("span", _hoisted_3$1, "任务【" + toDisplayString((_ctx$job = _ctx.job) === null || _ctx$job === void 0 ? void 0 : _ctx$job.id) + "】详情", 1)]), createBaseVNode("div", _hoisted_4$1, [unref(formatedJob) ? (openBlock(), createElementBlock(Fragment, {
                                        key: 0
                                    }, [createVNode(_component_SimpleCollapse, {
                                        "model-value": true,
                                        "header-class": "bg-selected"
                                    }, {
                                        title: withCtx(function () {
                                            return _cache[3] || (_cache[3] = [createTextVNode(" 基本信息 ")]);
                                        }),
                                        actions: withCtx(function () {
                                            return [createBaseVNode("button", {
                                                class: "a-primary",
                                                onClick: _cache[0] || (_cache[0] = function ($event) {
                                                    return unref(copy)(unref(formatedJob));
                                                })
                                            }, toDisplayString(unref(copied) ? "✓ 已复制" : "复制"), 1)];
                                        }),
                                        default: withCtx(function () {
                                            return [createVNode(_component_ShikiCode, {
                                                code: unref(formatedJob),
                                                lang: "json",
                                                class: "bg-blue/10 text-0.9rem"
                                            }, null, 8, ["code"])];
                                        }),
                                        _: 1
                                    }), (_ctx$job2 = _ctx.job) !== null && _ctx$job2 !== void 0 && _ctx$job2.sql ? (openBlock(), createBlock(_component_SimpleCollapse, {
                                        key: 0,
                                        "model-value": true,
                                        class: "mt-3",
                                        "header-class": "bg-selected"
                                    }, {
                                        title: withCtx(function () {
                                            return _cache[4] || (_cache[4] = [createTextVNode(" SQL 信息 ")]);
                                        }),
                                        actions: withCtx(function () {
                                            return [createBaseVNode("button", {
                                                class: "a-primary",
                                                onClick: _cache[1] || (_cache[1] = function ($event) {
                                                    var _ctx$job3;
                                                    return unref(copySql)((_ctx$job3 = _ctx.job) === null || _ctx$job3 === void 0 ? void 0 : _ctx$job3.sql);
                                                })
                                            }, toDisplayString(unref(sqlCopied) ? "✓ 已复制" : "复制"), 1)];
                                        }),
                                        default: withCtx(function () {
                                            return [createVNode(_component_ShikiCode, {
                                                code: _ctx.job.sql,
                                                lang: "sql",
                                                class: "bg-yellow/10 text-0.9rem"
                                            }, null, 8, ["code"])];
                                        }),
                                        _: 1
                                    })) : createCommentVNode("", true)], 64)) : (openBlock(), createBlock(_component_Empty, {
                                        key: 1,
                                        class: "h-full"
                                    }, {
                                        default: withCtx(function () {
                                            return _cache[5] || (_cache[5] = [createTextVNode(" 暂无详情 ")]);
                                        }),
                                        _: 1
                                    }))])])];
                                }),
                                _: 1
                            }, 8, ["modelValue"]);
                        };
                    }
                });
                var _hoisted_1 = {
                    class: "h-full flex flex-col gap-3"
                };
                var _hoisted_2 = {
                    class: "flex items-center justify-between rounded-md bg-base px-4 py-3 color-#666"
                };
                var _hoisted_3 = {
                    class: "flex items-center"
                };
                var _hoisted_4 = {
                    key: 0
                };
                var _hoisted_5 = {
                    class: "text-purple-600"
                };
                var _hoisted_6 = {
                    class: "relative flex-1 overflow-y-overlay rounded-md bg-base p-2 pt-0"
                };
                var _hoisted_7 = {
                    class: "w-full"
                };
                var _hoisted_8 = {
                    class: "sticky top-0 z-10 border-b border-base bg-base color-base"
                };
                var _hoisted_9 = {
                    class: "h-10 color-gray-700 font-600"
                };
                var _hoisted_10 = {
                    class: "p1 text-center"
                };
                var _hoisted_11 = {
                    class: "p1 text-center"
                };
                var _hoisted_12 = {
                    class: "ws-nowrap p1 text-center"
                };
                var _hoisted_13 = {
                    class: "text-0.9rem color-gray"
                };
                var _hoisted_14 = ["onClick"];
                var _hoisted_15 = {
                    class: "min-w-16 ws-nowrap text-center op50"
                };
                var _hoisted_16 = {
                    class: "min-w-30 ws-nowrap text-center"
                };
                var _hoisted_17 = ["onClick"];
                var _hoisted_18 = {
                    class: "relative min-w-30 ws-nowrap text-center"
                };
                var _hoisted_19 = {
                    class: "h-10 min-w-30 flex-center gap-2 ws-nowrap"
                };
                var _hoisted_20 = {
                    class: "flex-center gap-2 text-purple-600"
                };
                var _hoisted_21 = {
                    class: "min-w-30 ws-nowrap text-center"
                };
                var _hoisted_22 = {
                    class: "min-w-40 ws-nowrap text-center"
                };
                var _hoisted_23 = {
                    class: "min-w-40 ws-nowrap text-center"
                };
                var _hoisted_24 = {
                    class: "min-w-30 flex-center gap-3 ws-nowrap text-0.9rem"
                };
                var _hoisted_25 = ["onClick"];
                var _hoisted_26 = {
                    class: "flex items-center gap-3 p-4"
                };
                var _hoisted_27 = ["onClick"];
                var _hoisted_28 = {
                    key: 0,
                    class: "h-full w-full flex-center"
                };
                var _sfc_main$1 = /* @__PURE__ */defineComponent({
                    __name: "index",
                    setup: function setup(__props) {
                        var route = useRoute();
                        var modelIdFromModelPage = computed(function () {
                            var _route$query;
                            return ((_route$query = route.query) === null || _route$query === void 0 ? void 0 : _route$query.modelIdFromModelPage) || "";
                        });
                        var modelNameFromModelPage = computed(function () {
                            var _route$query2;
                            return decodeURIComponent(((_route$query2 = route.query) === null || _route$query2 === void 0 ? void 0 : _route$query2.modelNameFromModelPage) || "");
                        });
                        var sortby = ref("order");
                        var direction = ref("desc");
                        var jobs = ref([]);
                        var loading = ref(false);
                        var currId = ref("");
                        var filterStatus = ref("all");
                        var statusList = computed(function () {
                            return [{
                                label: "全部任务",
                                value: "all",
                                list: jobs.value,
                                class: "!text-primary-700 !bg-primary-400/15 !hover:bg-primary-400/15"
                            }, {
                                label: "已完成",
                                value: "completed",
                                list: jobs.value.filter(function (u) {
                                    return u.status === "COMPLETED";
                                }),
                                class: "!text-green-600 !bg-green-400/15 !hover:bg-green-400/15"
                            }, {
                                label: "运行中",
                                value: "running",
                                list: jobs.value.filter(function (u) {
                                    return u.status === "RUNNING";
                                }),
                                class: "!text-blue-500 !bg-blue-400/15 !hover:bg-blue-400/15"
                            }, {
                                label: "失败",
                                value: "failed",
                                list: jobs.value.filter(function (u) {
                                    return u.status === "FAILED";
                                }),
                                class: "!text-red-500 !bg-red-400/15 !hover:bg-red-400/15"
                            }];
                        });
                        var sortFunctions = {
                            order: function order(a, b) {
                                return dayjs(a.createTime).valueOf() - dayjs(b.createTime).valueOf();
                            },
                            modelName: function modelName(a, b) {
                                return a.modelName.localeCompare(b.modelName);
                            },
                            createTime: function createTime(a, b) {
                                return dayjs(a.createTime).valueOf() - dayjs(b.createTime).valueOf();
                            }
                        };
                        var startTimes = computed(function () {
                            return _toConsumableArray(jobs.value).sort(sortFunctions.createTime).reverse().map(function (u) {
                                return u.createTime;
                            });
                        });
                        var sorted = computed(function () {
                            var _statusList$value$fin;
                            var sortFn = sortFunctions[sortby.value];
                            var list = ((_statusList$value$fin = statusList.value.find(function (u) {
                                return u.value === filterStatus.value;
                            })) === null || _statusList$value$fin === void 0 ? void 0 : _statusList$value$fin.list) || jobs.value;
                            var sorted2 = _toConsumableArray(list).sort(sortFn);
                            if (direction.value === "desc") sorted2.reverse();
                            return sorted2;
                        });

                        function toggleSortedBy(by) {
                            if (sortby.value === by) direction.value = direction.value === "asc" ? "desc" : "asc"; else sortby.value = by;
                        }

                        function getData() {
                            return _getData.apply(this, arguments);
                        }

                        function _getData() {
                            _getData = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
                                var params;
                                return _regeneratorRuntime().wrap(function _callee$(_context) {
                                    while (1) switch (_context.prev = _context.next) {
                                        case 0:
                                            loading.value = true;
                                            params = {
                                                page: 1,
                                                pageSize: 800
                                            };
                                            if (modelIdFromModelPage.value) params.modelId = modelIdFromModelPage.value;
                                            getJobList(params).then(function (res) {
                                                jobs.value = res.data;
                                            }).catch(function () {
                                                jobs.value = [];
                                            }).finally(function () {
                                                loading.value = false;
                                            });
                                        case 4:
                                        case "end":
                                            return _context.stop();
                                    }
                                }, _callee);
                            }));
                            return _getData.apply(this, arguments);
                        }

                        onMounted(getData);
                        var showDetailDrawer = ref(false);
                        var selectedJob = ref();

                        function showJobDetail(job) {
                            selectedJob.value = job;
                            showDetailDrawer.value = true;
                        }

                        var router = useRouter();

                        function showJobResult(info) {
                            if (info.status !== "COMPLETED") {
                                api.warn("任务未成功完成，无法查看结果");
                                return;
                            }
                            currId.value = info.id;
                            router.push({
                                name: "JobResult",
                                query: {
                                    id: info.id,
                                    modelId: info.modelId,
                                    modelName: info.modelName
                                }
                            });
                        }

                        function confirmDelete(info) {
                            deleteJob(info.id).then(function () {
                                api.success("删除成功");
                                getData();
                            });
                        }

                        return function (_ctx, _cache) {
                            var _component_SelectGroup = _sfc_main$7;
                            var _component_IconButton = _sfc_main$8;
                            var _component_Loading = _sfc_main$9;
                            var _component_VDropdown = resolveComponent("VDropdown");
                            var _component_Empty = _sfc_main$5;
                            return openBlock(), createElementBlock("div", _hoisted_1, [createBaseVNode("div", _hoisted_2, [createBaseVNode("div", _hoisted_3, [unref(modelIdFromModelPage) && unref(modelNameFromModelPage) ? (openBlock(), createElementBlock("span", _hoisted_4, [_cache[5] || (_cache[5] = createTextVNode(" 模型")), createBaseVNode("span", _hoisted_5, "【" + toDisplayString(unref(modelNameFromModelPage)) + " - " + toDisplayString(unref(modelIdFromModelPage)) + "】", 1), _cache[6] || (_cache[6] = createTextVNode("共关联： "))])) : createCommentVNode("", true), createVNode(_component_SelectGroup, {
                                modelValue: unref(filterStatus),
                                "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
                                    return isRef(filterStatus) ? filterStatus.value = $event : null;
                                }),
                                options: unref(statusList).map(function (i) {
                                    return i.value;
                                }),
                                titles: unref(statusList).map(function (i) {
                                    return "".concat(i.label, "\uFF1A").concat(i.list.length);
                                }),
                                props: unref(statusList).map(function (i) {
                                    return {
                                        class: "".concat(i.value === unref(filterStatus) ? i.class : "")
                                    };
                                })
                            }, null, 8, ["modelValue", "options", "titles", "props"])]), createVNode(_component_IconButton, {
                                class: "h-7 w-7",
                                "icon-class": "i-mdi:refresh",
                                title: "刷新",
                                onClick: getData
                            })]), createBaseVNode("div", _hoisted_6, [unref(loading) ? (openBlock(), createBlock(_component_Loading, {
                                key: 0
                            })) : (openBlock(), createElementBlock(Fragment, {
                                key: 1
                            }, [withDirectives(createBaseVNode("table", _hoisted_7, [createBaseVNode("thead", _hoisted_8, [createBaseVNode("tr", _hoisted_9, [createBaseVNode("th", _hoisted_10, [createBaseVNode("button", {
                                onClick: _cache[1] || (_cache[1] = function ($event) {
                                    return toggleSortedBy("order");
                                })
                            }, [_cache[7] || (_cache[7] = createTextVNode(" 序号 ")), unref(sortby) === "order" ? (openBlock(), createElementBlock("div", {
                                key: 0,
                                class: normalizeClass([unref(direction) === "asc" ? "i-carbon-arrow-down" : "i-carbon-arrow-up"])
                            }, null, 2)) : createCommentVNode("", true)])]), _cache[10] || (_cache[10] = createBaseVNode("th", {
                                class: "p1 text-center"
                            }, " 任务 ID ", -1)), _cache[11] || (_cache[11] = createBaseVNode("th", {
                                class: "p1 text-center",
                                colspan: "1"
                            }, " 执行程序 ", -1)), createBaseVNode("th", _hoisted_11, [createBaseVNode("button", {
                                onClick: _cache[2] || (_cache[2] = function ($event) {
                                    return toggleSortedBy("modelName");
                                })
                            }, [_cache[8] || (_cache[8] = createTextVNode(" 所用模型 ")), unref(sortby) === "modelName" ? (openBlock(), createElementBlock("div", {
                                key: 0,
                                class: normalizeClass([unref(direction) === "desc" ? "i-carbon-arrow-down" : "i-carbon-arrow-up"])
                            }, null, 2)) : createCommentVNode("", true)])]), _cache[12] || (_cache[12] = createBaseVNode("th", {
                                class: "p1 text-center"
                            }, " 任务状态 ", -1)), createBaseVNode("th", _hoisted_12, [createBaseVNode("button", {
                                onClick: _cache[3] || (_cache[3] = function ($event) {
                                    return toggleSortedBy("createTime");
                                })
                            }, [_cache[9] || (_cache[9] = createTextVNode(" 开始时间 ")), unref(sortby) === "createTime" ? (openBlock(), createElementBlock("div", {
                                key: 0,
                                class: normalizeClass([unref(direction) === "desc" ? "i-carbon-arrow-down" : "i-carbon-arrow-up"])
                            }, null, 2)) : createCommentVNode("", true)])]), _cache[13] || (_cache[13] = createBaseVNode("th", {
                                class: "p1"
                            }, " 数据源起止 ", -1)), _cache[14] || (_cache[14] = createBaseVNode("th", {
                                class: "p1 text-center"
                            }, " 操作 ", -1))])]), createBaseVNode("tbody", _hoisted_13, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(sorted), function (item) {
                                return openBlock(), createElementBlock("tr", {
                                    key: item.id,
                                    class: normalizeClass(["h-10 hover:bg-hover", {
                                        "!bg-selected": unref(currId) === item.id
                                    }]),
                                    onClick: function onClick($event) {
                                        return currId.value = item.id;
                                    }
                                }, [createBaseVNode("td", _hoisted_15, toDisplayString(unref(startTimes).indexOf(item.createTime) + 1), 1), createBaseVNode("td", _hoisted_16, [createBaseVNode("code", {
                                    class: "cursor-pointer underline a-primary",
                                    onClick: function onClick($event) {
                                        return showJobDetail(item);
                                    }
                                }, toDisplayString(item.id), 9, _hoisted_17)]), createBaseVNode("td", _hoisted_18, [createBaseVNode("code", {
                                    style: normalizeStyle({
                                        color: unref(getHashColorFromString)(item.jobExecuter)
                                    })
                                }, toDisplayString(item.jobExecuter), 5)]), createBaseVNode("td", _hoisted_19, [createBaseVNode("div", _hoisted_20, [createBaseVNode("span", null, toDisplayString(item.modelName), 1), createBaseVNode("div", {
                                    class: normalizeClass(["text-1.1rem text-purple-400", item.resultType === "graph" ? "i-carbon:network-4" : "i-carbon:table-split"])
                                }, null, 2)])]), createBaseVNode("td", _hoisted_21, [createBaseVNode("span", {
                                    class: normalizeClass(["px-1.5 py-0.5", unref(getStatusColor)(item.status)])
                                }, toDisplayString(item.status), 3)]), createBaseVNode("td", _hoisted_22, toDisplayString(unref(formatToDateTime)(item.createTime)), 1), createBaseVNode("td", _hoisted_23, [createBaseVNode("code", null, toDisplayString(item.sourceDbId) + " → " + toDisplayString(item.destinationDbId), 1)]), createBaseVNode("td", _hoisted_24, [item.status === "COMPLETED" ? (openBlock(), createElementBlock("button", {
                                    key: 0,
                                    class: "a-primary",
                                    onClick: function onClick($event) {
                                        return showJobResult(item);
                                    }
                                }, " 结果 ", 8, _hoisted_25)) : createCommentVNode("", true), item.status !== "RUNNING" ? (openBlock(), createBlock(_component_VDropdown, {
                                    key: 1,
                                    placement: "left",
                                    distance: -10
                                }, {
                                    popper: withCtx(function () {
                                        return [createBaseVNode("div", _hoisted_26, [_cache[15] || (_cache[15] = createBaseVNode("span", null, "确认删除吗？", -1)), createBaseVNode("button", {
                                            class: "rounded bg-error px-2 py-1 text-sm text-white",
                                            onClick: function onClick($event) {
                                                return confirmDelete(item);
                                            }
                                        }, " 是的 ", 8, _hoisted_27)])];
                                    }),
                                    default: withCtx(function () {
                                        return [_cache[16] || (_cache[16] = createBaseVNode("button", {
                                            class: "a-error"
                                        }, " 删除 ", -1))];
                                    }),
                                    _: 2
                                }, 1024)) : createCommentVNode("", true)])], 10, _hoisted_14);
                            }), 128))])], 512), [[vShow, unref(sorted).length > 0]]), !unref(sorted) || unref(sorted).length === 0 ? (openBlock(), createElementBlock("div", _hoisted_28, [createVNode(_component_Empty, {
                                icon: "i-carbon:border-none op60 text-1.4rem"
                            }, {
                                default: withCtx(function () {
                                    return _cache[17] || (_cache[17] = [createBaseVNode("span", {
                                        class: "op60"
                                    }, "暂无任务", -1)]);
                                }),
                                _: 1
                            })])) : createCommentVNode("", true)], 64))]), createVNode(_sfc_main$2, {
                                modelValue: unref(showDetailDrawer),
                                "onUpdate:modelValue": _cache[4] || (_cache[4] = function ($event) {
                                    return isRef(showDetailDrawer) ? showDetailDrawer.value = $event : null;
                                }),
                                job: unref(selectedJob)
                            }, null, 8, ["modelValue", "job"])]);
                        };
                    }
                });

                /* unplugin-vue-components disabled */

                var JobList = /* @__PURE__ */_export_sfc(_sfc_main$1, [["__scopeId", "data-v-e5b446fd"]]);
                var _sfc_main = exports("default", /* @__PURE__ */defineComponent({
                    __name: "index",
                    setup: function setup(__props) {
                        var route = useRoute();
                        var isRoot = computed(function () {
                            return route.path === "/job/list";
                        });
                        return function (_ctx, _cache) {
                            var _component_RouterView = resolveComponent("RouterView");
                            return openBlock(), createElementBlock(Fragment, null, [createVNode(JobList), createBaseVNode("div", {
                                class: normalizeClass(["fixed bottom-0 left-0 right-0 top-0 z-10 flex overflow-hidden bg-black:60 transition-all", unref(isRoot) ? "pointer-events-none opacity-0" : "opacity-100"])
                            }, [createBaseVNode("div", {
                                class: "h-full min-w-100px flex-auto",
                                onClick: _cache[0] || (_cache[0] = function ($event) {
                                    return _ctx.$router.go(-1);
                                })
                            }), createBaseVNode("div", {
                                class: normalizeClass(["h-full min-w-800px w-[calc(100%-200px)] transform overflow-hidden border-l border-base bg-base shadow-lg transition-transform duration-200", unref(isRoot) ? "translate-x-1/2" : "translate-x-0"])
                            }, [(openBlock(), createBlock(Suspense, null, {
                                fallback: withCtx(function () {
                                    return _cache[1] || (_cache[1] = [createTextVNode(" 加载中 ")]);
                                }),
                                default: withCtx(function () {
                                    return [createVNode(_component_RouterView, null, {
                                        default: withCtx(function (_ref) {
                                            var Component = _ref.Component;
                                            return [(openBlock(), createBlock(resolveDynamicComponent(Component)))];
                                        }),
                                        _: 1
                                    })];
                                }),
                                _: 1
                            }))], 2)], 2)], 64);
                        };
                    }
                }));
            }
        };
    });
})();
